package com.gitee.wsl.ext.number


fun Float.smoothStep(low: Float, high: Float): Float {
    val nx = ((this - low) / (high - low)).clamp(0f,1f)
    return nx * nx * (3 - 2 * nx)
}

fun Double.smoothStep(low: Double, high: Double): Double {
    val nx = ((this - low) / (high - low)).clamp(0.0,1.0)
    return nx * nx * (3 - 2 * nx)
}